#include "bsp_i2c.h"
#include "bsp_weeecorebot.h"
#include "esp_log.h"
#include <iostream>
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

static const char *TAG = "main";


extern "C" void app_main(void)
{   

    i2c_master_bus_handle_t bus_handle;
    i2c_master_dev_handle_t dev_handle;
    bsp_i2c_init(&bus_handle, &dev_handle);

    weeecorebot_add_device(bus_handle, &dev_handle);


    weeecorebot_device_info_t device_info;
    weeecorebot_read_device_info(dev_handle, &device_info);
    printf("Device info: %s\n", device_info.device_name);
    printf("Device info: %s\n", device_info.firmware_version);
    printf("Device info: %s\n", device_info.build_date);
    printf("Device info: %s\n", device_info.build_time);

    weeecorebot_motor_status_t motor_status;

    
    // 主循环
    while (true)
    {   
        vTaskDelay(pdMS_TO_TICKS(50));
    }
}
